This repository was archived by the owner on May 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b07a106
to
122d281
Compare
122d281
to
54e3a27
Compare
54e3a27
to
b926519
Compare
703c817
to
61b1763
Compare
noahingh
commented
Apr 23, 2022
Comment on lines
+259
to
+275
func (i *DeploymentInteractor) CreateDeploymentStatus(ctx context.Context, ds *ent.DeploymentStatus) (*ent.DeploymentStatus, error) { | ||
ds, err := i.store.CreateEntDeploymentStatus(ctx, ds) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if _, err := i.store.CreateEvent(ctx, &ent.Event{ | ||
Kind: event.KindDeploymentStatus, | ||
Type: event.TypeCreated, | ||
DeploymentStatusID: ds.ID, | ||
}); err != nil { | ||
i.log.Error("Failed to dispatch the event.", zap.Error(err)) | ||
} | ||
|
||
return ds, nil | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add CreateDeploymentStatus
method and create a event internally.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
component: server
This issue or pull request is related to the feature of the server-side
enhancement
New feature or request
schema-migration
This pull request has a schema-migration
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When an event includes only a deployment, it isn't easy to get the status, description, and log_url of deployment status. To resolve this, we should add deployment_status as an event type and build a detailed notification message with a deployment status.
Schema
The schema contains two changes: 1) By adding
deployment_status
as an event type, a notification can include status and description of deployment when fired. 2) Denormalizerepo_id
inDeploymentStatus
to retrieve repository information.